"""firstproject URL Configuration

The `urlpatterns` list routes URLs to views. For more information please see:
    https://docs.djangoproject.com/en/3.2/topics/http/urls/
Examples:
Function views
    1. Add an import:  from my_app import views
    2. Add a URL to urlpatterns:  path('', views.home, name='home')
Class-based views
    1. Add an import:  from other_app.views import Home
    2. Add a URL to urlpatterns:  path('', Home.as_view(), name='home')
Including another URLconf
    1. Import the include() function: from django.urls import include, path
    2. Add a URL to urlpatterns:  path('blog/', include('blog.urls'))
"""
from django.urls import path, include

from bookmanage.views import addbook
from bookmanage.views import showbook
from bookmanage.views import delbook
from bookmanage.views import homepage
from bookmanage.views import bookinfocollect
from bookmanage.views import showbooks
from bookmanage.views import updatebook
from bookmanage.views import changebookinfo
from bookmanage.views import testfunction
from bookmanage.views import showimg
from bookmanage.views import querybook

# name  飘  price  100.05  isbn 1234567890123

# name/飘/price/100.05/isbn/1234567890123
# /?name=飘&price=100.05&isbn=1234567890123

# delbook/<int:bookid>

#     取数据

# getbook/?id=1   取 id=1 的那本书
#     getbook/1   书id


urlpatterns = [
    path("addbook/", addbook, name="addbook"),  # 添加书籍的界面
    path("bookinfocollect/", bookinfocollect, name="bookinfocollect"),

    path("showbook/<int:bookid>", showbook, name="showbook"),
    path("delbook/<int:bookid>", delbook, name="delbook"),

    path("showbooks/", showbooks, name="showbooks"),

    path("updatabook/<int:bookid>", updatebook, name="updatebook"),
    path("changebookinfo/", changebookinfo, name="changebookinfo"),

    path("homepage/", homepage),
    path("testfunction/", testfunction),
    path("showimg/", showimg, name="showimg"),

    path("querybook/", querybook, name="querybook"),

]
